
var table1 = {
    id: "table1",	//表格id
    table: null,
    layerIndex: -1
};

var ids=new Array();
/**
 * 初始化表格的列
 */
table1.initColumn = function () {
    return [
        {field: 'selectItem', radio: false},
        {title: '编号', field: 'record_no', visible: true, align: 'center', valign: 'middle'},
        {title: '接收方', field: 'receiver', visible: true, align: 'center', valign: 'middle'},
        // {title: '发送方', field: 'sender', visible: true, align: 'center', valign: 'middle'},
        {title: '发送时间', field: 'send_time', visible: true, align: 'center', valign: 'middle' },
        {title: '发送方式', field: 'process_method', visible: true, align: 'center', valign: 'middle',
            formatter : function(value,row,index){
             if(row.process_method=='1'){
                return "邮寄";
            }else if(row.process_method=='2'){
                    return "司机带回";
            }else if(row.process_method=='3'){
                return "其他";
            }
        }
        },
        {title: '操作',  visible: true, align: 'center', valign: 'middle',
            formatter:function(value,row,index){
               return  "<a href='javascript:;' onclick='table1.download(\""+row.id+ "\");' >导出Execl</a>";
            }
        }
        ];
};
table1.download=function (id){
    location.href=Feng.ctxPath + "/orderBack/export?id="+id;
}
$(function () {
    var defaultColunms = table1.initColumn();
    var mTable = new BSTable(table1.id, "/orderBack/orderBackRecordList", defaultColunms);
    mTable.init();
    table1.table = mTable;

    // var table = new BSTable(table2.id, "", defaultColunms);
    // table.setDblClickRow(removeRow);
    // table.init();
    // table2.table = table;

    layui.use('layer', function () { })

    // $('#type').selectpicker({
    //     style: 'btn btn-select',
    //     noneSelectedText:"运单类型"
    // });
    // $('#is_out').selectpicker({
    //     style: 'btn btn-select',
    //     noneSelectedText:"运单状态"
    // });
    // $('#receipt_status').selectpicker({
    //     style: 'btn btn-select',
    //     noneSelectedText:"回单状态"
    // });
});
